﻿Imports System.ComponentModel

Public Class Current
    Implements INotifyPropertyChanged
    Public Sub New()
        voltageValue = 0.0
    End Sub

    Public Sub New(ByVal volt As Double)
        voltageValue = volt
    End Sub
#Region "Property"
    Private voltageValue As Double
    Public Property Voltage As Double
        Get
            Return voltageValue
        End Get
        Set(ByVal value As Double)
            If value = voltageValue Then Return
            If value < 0 Then
                voltageValue = 0.0
            Else
                voltageValue = value
            End If
            OnPropertyChanged(New PropertyChangedEventArgs("Voltage"))
        End Set
    End Property
#End Region
    Public Event PropertyChanged(ByVal sender As Object, ByVal e As PropertyChangedEventArgs) Implements INotifyPropertyChanged.PropertyChanged

    Public Sub OnPropertyChanged(ByVal e As PropertyChangedEventArgs)
        RaiseEvent PropertyChanged(Me, e)
    End Sub
End Class
